<?php
/**
 * Created by PhpStorm.
 * User: Guangpeng Chen
 * Date: 10-10/0010
 * Time: 14:29
 */
define('ROOT_PATH','/var/www/html/new/d/');
define('FX_PATH', ROOT_PATH.'class/');
include ROOT_PATH . 'common/autoload.php';

$tpl = Tpl::getLink();
$pids = $tpl->productsIdToRule(0, 94);

$sql = "SELECT id,p_name FROM uu_products WHERE id IN(".implode(',', $pids).")";
$GLOBALS['le']->query($sql);
$data = array();
while($row=$GLOBALS['le']->fetch_assoc()) {
    $data[] = $row;
}
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>I need a form!</title>
</head>
<body>
<form action="save.php" method="post">
    <p>标题<input type="text" name="title" placeholder="title" id=""/></p>
    <p>备注<input type="text" name="note" placeholder="note" id=""/></p>
    <p>
        价格配置方式<select name="dptype" id="">
            <option value="0">结算价+</option>
            <option value="1">零售价-</option>
        </select>
        <input type="number" name="dpercent" placeholder="金额" id=""/>
        <select name="mtype" id="">
            <option value="1">元</option>
            <option value="2">%</option>
            <option value="3">佣金%</option>
        </select>
    </p>
    <p>
        通用配置：
        <textarea name="defaultCfg" id="" cols="30" rows="10">
            <?=var_export($pids)?>
        </textarea>
    </p>
    <p>
        特别配置：
        <textarea name="specialCfg" id="" cols="30" rows="10"></textarea>
    </p>
    <p>
        <button type="submit">Save Me!</button>
    </p>
</form>
</body>
</html>